<?php

include "sendquery_db.php";

$username = $_GET['joiner'];
$room = $_GET['want_room'];
$pswd = $_GET['pswd_check'];
$db = dbservice::getInstance();


	

	$result =$db -> sendquery("select password from sendserver where roomnum = '$room'");
 	
 	
 	if($result){
		foreach($result as $output){
				
			if(!strcmp($pswd, $output['password'])){
				
				$db -> sendquery("insert into participant values($room,'$username')");	
			}else{
				
				echo "retype password";	
			}
		} 
	
	}
	

?>
